// List.h: interface for the List class.
//
//////////////////////////////////////////////////////////////////////


#if !defined(AFX_LIST_H__41773486_CF2C_4EFD_AD94_89ABA391DE21__INCLUDED_)
#define AFX_LIST_H__41773486_CF2C_4EFD_AD94_89ABA391DE21__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <stdexcept>
using namespace std;
const int defMaxListSize=10;
typedef char DataType;
class List  
{
public:
	//List();
	List(int maxNumber=defMaxListSize) throw(bad_alloc);
	~List();

private:
	int maxSize;
	// Actual number of data item in the list
	int size;
	// cursor array index
	int cursor;
	DataType* dataItems;//Array containing the list data item
public:
	void clear();
	bool isEmpty() const;
	bool isFull() const;
	void showStructure()const;
	// 
	void gotoBeginning()throw(logic_error);
	void gotoEnd()throw(logic_error);
	bool gotoNext()throw(logic_error);
	bool gotoPrior()throw(logic_error);
	DataType getCursor() const throw(logic_error);
	void insert(const DataType& newDataItem)throw(logic_error);
	void remove()throw(logic_error);
	void replace(const DataType& newDataItem)throw(logic_error);
	void moveToNth(int n) throw(logic_error);
	bool find(const DataType & searchDataItem)throw(logic_error);
};

#endif // !defined(AFX_LIST_H__41773486_CF2C_4EFD_AD94_89ABA391DE21__INCLUDED_)
